﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class TouchControls : MonoBehaviour {

	// Use this for initialization
	void Start () {
	
	}

	void Touched()
	{

	}
	void LetGo()
	{
	}
	void Dragging()
	{

	}
	void Controls()
	{
		TouchScript[] allTouchableObjects = FindObjectsOfType(typeof(TouchScript)) as TouchScript[];
		foreach (Touch touch in Input.touches) 
		{

			for(int i = 0; i < allTouchableObjects.Length; i++)
			{
				allTouchableObjects[i].Move(Camera.main.ScreenToWorldPoint(touch.position), touch.phase, touch.fingerId);
			}

		}
	}
	// Update is called once per frame
	void Update () {
		Controls();
	}
}
